#include "MainWindow.h"
#include "ui_MainWindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    ui->TitleWidget->hide();
    ui->PlaylistWidget->hide();

    connect(ui->CtrlBarWid, &CtrlBarWidget::playOrPausedClicked, this, &MainWindow::onPlayOrPaused);
    connect(VideoCtrl::getInstance(), &VideoCtrl::SigFrameDimensionChanged, ui->ShowWid, &Show::onFrameDimensionChanged, Qt::QueuedConnection);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::onPlayOrPaused(bool isChecked)
{
    if (isChecked) {//播放
        QString strFileName = "D:\\AppDownload\\迅雷下载\\[电影天堂www.dytt89.com]哪吒之魔童降世-2019_蓝光国英双语中英双字精校版.mp4";
        ui->ShowWid->play(strFileName);
    }
    else {//暂停

    }
}
